import request from '@/utils/request'

export function menuTree(query) {
  return request({
    url: '/menu/tree',
    method: 'get',
    params: query
  })
}

export function menuAdd(data) {
  return request({
    url: '/menu/add',
    method: 'post',
    data
  })
}

export function menuDelete(data) {
  return request({
    url: '/menu/delete',
    method: 'post',
    data
  })
}

export function menuGet(query) {
  return request({
    url: '/menu/get',
    method: 'get',
    params: query
  })
}

export function buttonPage(query) {
  return request({
    url: '/button/page',
    method: 'get',
    params: query
  })
}

export function dataListPage(query) {
  return request({
    url: '/dataList/page',
    method: 'get',
    params: query
  })
}

export function dataInterfacePage(query) {
  return request({
    url: '/dataInterface/page',
    method: 'get',
    params: query
  })
}

export function buttonAdd(data) {
  return request({
    url: '/button/add',
    method: 'post',
    data
  })
}

export function buttonUpdateState(data) {
  return request({
    url: '/button/updateState',
    method: 'post',
    data
  })
}

export function dataListAdd(data) {
  return request({
    url: '/dataList/add',
    method: 'post',
    data
  })
}

export function updateDataListAttr(data) {
  return request({
    url: '/dataList/updateDataListAttr',
    method: 'post',
    data
  })
}

export function buttonDelete(data) {
  return request({
    url: '/button/delete',
    method: 'post',
    data
  })
}

export function dataListDelete(data) {
  return request({
    url: '/dataList/delete',
    method: 'post',
    data
  })
}

export function menuSort(data) {
  return request({
    url: '/menu/sort',
    method: 'post',
    data
  })
}

export function getButtonByDataList(query) {
  return request({
    url: '/button/getButtonByDataList',
    method: 'get',
    params: query
  })
}
